/* XXL-JOB 文档优化样式 */

/* 优化后的 body - 给内容添加左边距 */
body.xxljob-optimized {
  margin-left: 280px !important;
  transition: margin-left 0.3s ease;
}

/* 目录折叠时，body 恢复正常 */
body.xxljob-optimized.toc-collapsed {
  margin-left: 0 !important;
}

/* 主布局容器（备用，兼容性） */
.xxljob-optimized-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background-color: #f5f7fa;
}

/* 左侧目录容器 */
.xxljob-toc-container {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border-right: 1px solid #e1e4e8;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 0;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, width 0.3s ease;
  z-index: 1000;
}

/* 折叠状态 */
.xxljob-toc-container.collapsed {
  transform: translateX(-280px);
}

/* 目录标题 */
.toc-title {
  font-size: 18px;
  font-weight: 700;
  color: #24292e;
  padding: 0 20px 15px;
  border-bottom: 2px solid #0366d6;
  margin-bottom: 15px;
}

/* 目录列表 */
.toc-list,
.xxljob-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li,
.xxljob-toc-list li {
  margin: 0;
  padding: 0;
}

.toc-list a,
.xxljob-toc-list a {
  display: block;
  padding: 8px 20px;
  color: #586069;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.6;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.toc-list a:hover,
.xxljob-toc-list a:hover {
  background-color: #f6f8fa;
  color: #0366d6;
  border-left-color: #0366d6;
}

.toc-list a.active,
.xxljob-toc-list a.active {
  background-color: #e8f4ff;
  color: #0366d6;
  font-weight: 600;
  border-left-color: #0366d6;
}

/* XXL-JOB 目录层级样式 */
.xxljob-toc-list > li > a {
  font-weight: 600;
  font-size: 15px;
  color: #24292e;
  padding-top: 10px;
  padding-bottom: 10px;
}

.xxljob-toc-list > li > ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.xxljob-toc-list > li > ul > li > a {
  padding-left: 25px;
  font-size: 14px;
}

.xxljob-toc-list > li > ul > li > ul > li > a {
  padding-left: 40px;
  font-size: 13px;
}

.xxljob-toc-list > li > ul > li > ul > li > ul > li > a {
  padding-left: 55px;
  font-size: 12px;
}

/* 不同层级的缩进（通用） */
.toc-level-1 a {
  font-weight: 600;
  font-size: 15px;
  padding-left: 20px;
}

.toc-level-2 a {
  padding-left: 25px;
}

.toc-level-3 a {
  padding-left: 40px;
  font-size: 13px;
}

.toc-level-4 a {
  padding-left: 55px;
  font-size: 13px;
}

.toc-level-5 a,
.toc-level-6 a {
  padding-left: 70px;
  font-size: 12px;
}

/* toc-level 类的链接样式 */
a.toc-level-2 {
  font-weight: 600;
  font-size: 14px;
  padding-left: 20px !important;
  padding-top: 8px;
  padding-bottom: 8px;
}

a.toc-level-3 {
  padding-left: 35px !important;
  font-size: 13px;
}

a.toc-level-4 {
  padding-left: 50px !important;
  font-size: 12px;
}

/* 内容容器 */
.xxljob-content-container {
  margin-left: 280px;
  flex: 1;
  padding: 40px;
  max-width: 1200px;
  background-color: #ffffff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
  min-height: 100vh;
}

/* 当目录折叠时，内容区域扩展 */
.xxljob-toc-container.collapsed ~ .xxljob-content-container {
  margin-left: 0;
}

/* 控制按钮（启用/禁用插件） */
.xxljob-control-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e90ff 0%, #00bfff 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(30, 144, 255, 0.4);
  transition: all 0.3s ease;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.xxljob-control-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(30, 144, 255, 0.6);
  background: linear-gradient(135deg, #0080ff 0%, #00a8ff 100%);
}

.xxljob-control-btn:active {
  transform: scale(0.95);
}

/* 启用状态时，目录显示后，按钮移到目录右侧 */
body.xxljob-optimized .xxljob-control-btn.enabled {
  left: 290px;
}

/* 禁用状态 */
.xxljob-control-btn:not(.enabled) {
  background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
  box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.xxljob-control-btn:not(.enabled):hover {
  background: linear-gradient(135deg, #7f8c8d 0%, #6c7a7b 100%);
  box-shadow: 0 6px 20px rgba(149, 165, 166, 0.5);
}

/* 滚动条美化 */
.xxljob-toc-container::-webkit-scrollbar {
  width: 6px;
}

.xxljob-toc-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.xxljob-toc-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.xxljob-toc-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 内容区域的标题样式优化 */
.xxljob-content-container h1 {
  color: #24292e;
  border-bottom: 2px solid #e1e4e8;
  padding-bottom: 10px;
  margin-top: 0;
}

.xxljob-content-container h2 {
  color: #24292e;
  border-bottom: 1px solid #e1e4e8;
  padding-bottom: 8px;
  margin-top: 30px;
}

.xxljob-content-container h3,
.xxljob-content-container h4,
.xxljob-content-container h5,
.xxljob-content-container h6 {
  color: #24292e;
  margin-top: 24px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .xxljob-toc-container {
    width: 250px;
  }
  
  .xxljob-toc-container.collapsed {
    transform: translateX(-250px);
  }
  
  .xxljob-content-container {
    margin-left: 250px;
    padding: 20px;
  }
  
  .xxljob-toc-toggle {
    left: 260px;
  }
}

@media (max-width: 480px) {
  .xxljob-toc-container {
    width: 200px;
  }
  
  .xxljob-toc-container.collapsed {
    transform: translateX(-200px);
  }
  
  .xxljob-content-container {
    margin-left: 200px;
    padding: 15px;
  }
  
  .xxljob-toc-toggle {
    left: 210px;
  }
}

/* 代码块样式优化 */
.xxljob-content-container pre {
  background-color: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
}

.xxljob-content-container code {
  background-color: #f6f8fa;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

/* 表格样式优化 */
.xxljob-content-container table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
}

.xxljob-content-container table th,
.xxljob-content-container table td {
  border: 1px solid #e1e4e8;
  padding: 10px;
  text-align: left;
}

.xxljob-content-container table th {
  background-color: #f6f8fa;
  font-weight: 600;
}

/* 链接样式 */
.xxljob-content-container a {
  color: #0366d6;
  text-decoration: none;
}

.xxljob-content-container a:hover {
  text-decoration: underline;
}

